import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'path'
const path = require('path')
// import cesium from 'vite-plugin-cesium';

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue()],
  server:{
    host:'0.0.0.0',//解决vite use `--host` to expose
    port:8080,
    open:true,
    proxy:{
      '/api':{
        target:'http://localhost:3000',
        changeOrigin:true,
        ws:true,
        rewrite:path =>path.replace(/^\/api/,'')
      }
    }
  },
  resolve:{
    alias:[
      {
        find:'@',
        replacement:resolve(__dirname,'src')
      }
    ]
  }
})
